package com.uzai.console.enums;

/**
 * 支付宝账单状态
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum AlipayStatusEnum {
    TRADE_CLOSED(0,"关闭"),
    WAIT_BUYER_PAY(1,"等待付款"),
    TRADE_SUCCESS(2,"付款成功"),
    TRADE_FINISHED(3,"交易结束"),
    ;

    private Integer id;
    private String desc;

    AlipayStatusEnum(Integer id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static AlipayStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (AlipayStatusEnum type: AlipayStatusEnum.values()) {
            if (type.getId().intValue() == id.intValue()) {
                return type;
            }
        }
        return null;
    }
}
